<?php
/*
  $Id: header.php,v 1.1.1.1 2004/03/04 23:39:42 ccwjr Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2002 osCommerce

  Released under the GNU General Public License
*/

$languages = tep_get_languages();
$languages_array = array();
$languages_selected = DEFAULT_LANGUAGE;
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
  $languages_array[] = array('id' => $languages[$i]['code'],
                             'text' => $languages[$i]['name']);
  if ($languages[$i]['directory'] == $language) {
    $languages_selected = $languages[$i]['code'];
  }
}
?>
<!-- warnings //-->
<?php require(DIR_WS_INCLUDES . 'warnings.php'); ?>
<!-- warning_eof //-->

<table width="100%"  border="0" cellpadding="2" cellspacing="2" bgcolor="#AEBDCC">
  <tr>
    <td width="39%"><img src="images/o-s-commerce_2.png" /></td>
    <td width="61%" align="center"><!--Banner Script mods to fix TEXT ONLY ad area for Admin Header
    This ad area reserved for Security Alert System - Please DO NOT change! -->
      <!--Banner Script Start-->
      <!-- <iframe src="messages.php?s=header" frameborder="0" width="490" height="70" scrolling="no"  allowtransparency="true"></iframe> -->
      <!--Banner Script End-->
    </td>
  </tr>
  <tr class="main">
    <td align="center"><a href="http://mysite.com" target="_blank">Open Source Commerce</a> </td>
    <td align="center"><a href="<?php echo tep_href_link(FILENAME_DEFAULT);?>" class="admin_text"><strong><?php echo TEXT_ADMIN_HOME;?></strong></a> | <a href="http://forums.mysite.com" target="_blank" class="admin_text"><strong><?php echo TEXT_FORUMS;?></strong></a> | <a href="http://www.mysite.com/support/" target="_blank"><strong><font color="#0000FF"><?php echo TEXT_PURCHASE_SUPPORT;?></font></strong></a> | <a href="<?php echo tep_href_link(FILENAME_MERCHANT_ACCOUNT);?>" class="admin_text"><?php echo TEXT_MERCHANT;?></a></td>
  </tr>
  <tr class="main">
    <td colspan="2" align="center"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
  </tr>
</table>
<?php
// hide search bar when not logged in
if (basename($PHP_SELF) != FILENAME_LOGIN && basename($PHP_SELF) != FILENAME_PASSWORD_FORGOTTEN && basename($PHP_SELF) != FILENAME_LOGOFF) {
?>
<table width="100%"  border="0" cellspacing="2" cellpadding="2">
  <?php
  // RCO start
  if ($cre_RCO->get('header', 'search') !== true) {
    ?>
    <tr class="main">
      <td class="admin_text"> <?php echo tep_draw_form('frmcustsearch', FILENAME_CUSTOMERS, '', 'post')?>
        <?php $custparams="size=12 onblur=\"javascript:document.frmcustsearch.search.value='Customers';\" onclick=\"javascript:document.frmcustsearch.search.value='';\"";
        echo tep_draw_input_field('search','Customers',$custparams,false,'text',false);
        if (isset($_GET[tep_session_name()])) {
          echo tep_draw_hidden_field(tep_session_name(), $_GET[tep_session_name()]);
        }
        ?>
        </form>
        <?php echo tep_draw_form('frmcustnew', FILENAME_CREATE_ACCOUNT, '', 'get')?>
        <input type=submit value=new>
        <?php
        if (isset($_GET[tep_session_name()])) {
          echo tep_draw_hidden_field(tep_session_name(), $_GET[tep_session_name()]);
        }
        ?>
        </form>
        <?php $orderparams="size=8 onblur=\"javascript:document.frmordersearch.oID.value='Order ID';\" onfocus=\"javascript:document.frmordersearch.oID.value='';\"";?>
        | <?php echo tep_draw_form('frmordersearch', FILENAME_ORDERS, '', 'get').tep_draw_input_field('oID','Order ID',$orderparams,false,'text',false).tep_draw_input_field('action','edit','',false,'hidden',false)?>
        <?php
        if (isset($_GET[tep_session_name()])) {
          echo tep_draw_hidden_field(tep_session_name(), $_GET[tep_session_name()]);
        }
        ?>
        </form>
        <?php echo tep_draw_form('frmordernew', 'create_order.php', '', 'get')?>
        <input type=submit value=new>
        <?php
        if (isset($_GET[tep_session_name()])) {
          echo tep_draw_hidden_field(tep_session_name(), $_GET[tep_session_name()]);
        }
        ?>
        </form>
        | <?php echo tep_draw_form('frmprodsearch', FILENAME_CATEGORIES, '', 'post')?>
        <?php $prodparams="size=12 onblur=\"javascript:document.frmprodsearch.search.value='Products';\" onfocus=\"javascript:document.frmprodsearch.search.value='';\"";
        echo tep_draw_input_field('search','Products',$prodparams,false,'text',false);
        echo tep_draw_input_field('selected_box','catalog','',false,'hidden',false);
        if (isset($_GET[tep_session_name()])) {
          echo tep_draw_hidden_field(tep_session_name(), $_GET[tep_session_name()]);
        }
        ?>
        </form>
        | <?php echo tep_draw_form('frmarticlesearch', FILENAME_ARTICLES, '', 'get')?>
        <?php $articlesparams="size=12 onblur=\"javascript:document.frmarticlesearch.search.value='Articles';\" onfocus=\"javascript:document.frmarticlesearch.search.value='';\"";
        echo tep_draw_input_field('search','Articles',$articlesparams,false,'text',false);
        if (isset($_GET[tep_session_name()])) {
          echo tep_draw_hidden_field(tep_session_name(), $_GET[tep_session_name()]);
        }
        ?>
        </form>
        | <?php echo tep_draw_form('frmpagesearch', FILENAME_PAGES, '', 'get')?>
        <?php $articlesparams="size=12 onblur=\"javascript:document.frmpagesearch.search.value='Pages';\" onfocus=\"javascript:document.frmpagesearch.search.value='';\"";
        echo tep_draw_input_field('search','Pages',$articlesparams,false,'text',false);
        if (isset($_GET[tep_session_name()])) {
          echo tep_draw_hidden_field(tep_session_name(), $_GET[tep_session_name()]);
        }
        ?>
        </form>
        <!--|  <input value=FAQ size=12> |-->
     </td>
      <td align="right" class="main"><?php echo TEXT_ADMIN_LANG . tep_draw_form('languages', 'index.php', '', 'get');
      echo tep_draw_pull_down_menu('language', $languages_array, $languages_selected, 'onChange="this.form.submit();"');
      if (isset($_GET[tep_session_name()])) {
        echo tep_draw_hidden_field(tep_session_name(), $_GET[tep_session_name()]);
      }
      ?> | <a href="<?php echo tep_href_link(FILENAME_LOGOFF);?> " class="main"><?php echo TEXT_LOGOUT;?></a>
      </form>
    </td>
    </tr>
    <?php
  } // end RCO
  ?>
  </table>
  <script type="text/javascript" src="includes/menu.js"></script>
  <?php
  if (MENU_DHTML == 'True') require(DIR_WS_INCLUDES . 'header_navigation.php');
  if ($messageStack->size('search') > 0) {
    echo $messageStack->output('search');
  }
} // end hide
?>